﻿@model projectManagementWeb.Models.RegisterModel

@{
    ViewBag.Title = "Detalles del Usuario";
}

    <p align="right">
            @Html.ActionLink("<< Regresar", "AdminAccounts","Admin")
    </p>

<fieldset>
    <legend>Bienvenido</legend>
    <h1>@User.Identity.Name</h1>
    @{
        projectManagementWeb.Controllers.DeveloperController controlLayer = new projectManagementWeb.Controllers.DeveloperController();
        projectManagementWeb.Models.Developer.UserDataModel userData = controlLayer.GetUserData(@User.Identity.Name);        
        

        string userNameLocal = string.Empty;
    
        <h2>@userData.UserCompleteName</h2>
        <h2>@userData.UserMail</h2>
    
    }
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true, "No se pudo modificar el usuario. Corrija los errores e intentelo de nuevo.")
    <div>
        <fieldset>
            <legend>Información del Usuario</legend>
            <table>
                <tr>
                    <td  class="editor-label">@Html.LabelFor(m => m.UserName)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.UserName) @Html.ValidationMessageFor(m => m.UserName)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.FirstName)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.FirstName) @Html.ValidationMessageFor(m => m.FirstName)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.LastName)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.LastName) @Html.ValidationMessageFor(m => m.LastName)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Email)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.Email) @Html.ValidationMessageFor(m => m.Email)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Password)</td>
                    <td class="editor-field">@Html.PasswordFor(m => m.Password) @Html.ValidationMessageFor(m => m.Password)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.ConfirmPassword)</td>
                    <td class="editor-field">@Html.PasswordFor(m => m.ConfirmPassword) @Html.ValidationMessageFor(m => m.ConfirmPassword)
                    @Html.HiddenFor(m=> m.OldPassword)
                    @Html.HiddenFor(m => m.oldRol)
                    </td>
                </tr>
                <tr>
                @{
                var QuestionList = new List<SelectListItem>(){
                    new SelectListItem(){Value="-1",Text="------------------"},
                    new SelectListItem(){Value="Comida Favorita",Text="Comida Favorita"},
                    new SelectListItem(){Value="Bebida",Text="Bebida"},
                    new SelectListItem(){Value="Pelicula Favorita",Text="Pelicula Favorita"}
                };
                }
                    <td class="editor-label">@Html.LabelFor(m => m.Question)</td>
                    <td class="editor-field">@Html.DropDownListFor(m => m.Question, QuestionList) @Html.ValidationMessageFor(m => m.Question)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Answer)</td>
                    <td class="editor-field">@Html.TextBoxFor(m => m.Answer) @Html.ValidationMessageFor(m => m.Answer)</td>
                </tr>
                <tr>
                    <td class="editor-label">@Html.LabelFor(m => m.Rol)</td>
                    <td class="editor-field">@Html.DropDownListFor(m=> m.Rol, Model.SecurityRoles) @Html.ValidationMessageFor(m => m.Rol)
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="Actualizar" />
                    <input type="hidden" name="UpdateFlag" value="1" />
                    </td>
                </tr>
            </table>
        </fieldset>
 
    </div>
}
</fieldset>
